import VueRouter from 'vue-router'

//引入组件
import Index from '../pages'
import Home from '../pages/home/home'
import Login from '../pages/login/login'
import Register from '../pages/register/register'
import Center from '../pages/center/center'
import Storeup from '../pages/storeup/list'
import News from '../pages/news/news-list'
import NewsDetail from '../pages/news/news-detail'
import payList from '../pages/pay'

import yonghuList from '../pages/yonghu/list'
import yonghuDetail from '../pages/yonghu/detail'
import yonghuAdd from '../pages/yonghu/add'
import redianxinwenList from '../pages/redianxinwen/list'
import redianxinwenDetail from '../pages/redianxinwen/detail'
import redianxinwenAdd from '../pages/redianxinwen/add'
import shouyileibieList from '../pages/shouyileibie/list'
import shouyileibieDetail from '../pages/shouyileibie/detail'
import shouyileibieAdd from '../pages/shouyileibie/add'
import shouruxinxiList from '../pages/shouruxinxi/list'
import shouruxinxiDetail from '../pages/shouruxinxi/detail'
import shouruxinxiAdd from '../pages/shouruxinxi/add'
import zhichuxinxiList from '../pages/zhichuxinxi/list'
import zhichuxinxiDetail from '../pages/zhichuxinxi/detail'
import zhichuxinxiAdd from '../pages/zhichuxinxi/add'
import zhichuleixingList from '../pages/zhichuleixing/list'
import zhichuleixingDetail from '../pages/zhichuleixing/detail'
import zhichuleixingAdd from '../pages/zhichuleixing/add'
import shouzhiyusuanList from '../pages/shouzhiyusuan/list'
import shouzhiyusuanDetail from '../pages/shouzhiyusuan/detail'
import shouzhiyusuanAdd from '../pages/shouzhiyusuan/add'
import beiwangluList from '../pages/beiwanglu/list'
import beiwangluDetail from '../pages/beiwanglu/detail'
import beiwangluAdd from '../pages/beiwanglu/add'
import touzilicaiList from '../pages/touzilicai/list'
import touzilicaiDetail from '../pages/touzilicai/detail'
import touzilicaiAdd from '../pages/touzilicai/add'
import zhaiwuxinxiList from '../pages/zhaiwuxinxi/list'
import zhaiwuxinxiDetail from '../pages/zhaiwuxinxi/detail'
import zhaiwuxinxiAdd from '../pages/zhaiwuxinxi/add'
import yinxingchuxuList from '../pages/yinxingchuxu/list'
import yinxingchuxuDetail from '../pages/yinxingchuxu/detail'
import yinxingchuxuAdd from '../pages/yinxingchuxu/add'
import newstypeList from '../pages/newstype/list'
import newstypeDetail from '../pages/newstype/detail'
import newstypeAdd from '../pages/newstype/add'
import popupremindList from '../pages/popupremind/list'
import popupremindDetail from '../pages/popupremind/detail'
import popupremindAdd from '../pages/popupremind/add'
import aboutusList from '../pages/aboutus/list'
import aboutusDetail from '../pages/aboutus/detail'
import aboutusAdd from '../pages/aboutus/add'
import systemintroList from '../pages/systemintro/list'
import systemintroDetail from '../pages/systemintro/detail'
import systemintroAdd from '../pages/systemintro/add'
import discussredianxinwenList from '../pages/discussredianxinwen/list'
import discussredianxinwenDetail from '../pages/discussredianxinwen/detail'
import discussredianxinwenAdd from '../pages/discussredianxinwen/add'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
	routes:[
		{
      path: '/',
      redirect: '/index/home'
    },
		{
			path: '/index',
			component: Index,
			children:[
				{
					path: 'home',
					component: Home
				},
				{
					path: 'center',
					component: Center,
				},
				{
					path: 'pay',
					component: payList,
				},
				{
					path: 'storeup',
					component: Storeup
				},
				{
					path: 'news',
					component: News
				},
				{
					path: 'newsDetail',
					component: NewsDetail
				},
				{
					path: 'yonghu',
					component: yonghuList
				},
				{
					path: 'yonghuDetail',
					component: yonghuDetail
				},
				{
					path: 'yonghuAdd',
					component: yonghuAdd
				},
				{
					path: 'redianxinwen',
					component: redianxinwenList
				},
				{
					path: 'redianxinwenDetail',
					component: redianxinwenDetail
				},
				{
					path: 'redianxinwenAdd',
					component: redianxinwenAdd
				},
				{
					path: 'shouyileibie',
					component: shouyileibieList
				},
				{
					path: 'shouyileibieDetail',
					component: shouyileibieDetail
				},
				{
					path: 'shouyileibieAdd',
					component: shouyileibieAdd
				},
				{
					path: 'shouruxinxi',
					component: shouruxinxiList
				},
				{
					path: 'shouruxinxiDetail',
					component: shouruxinxiDetail
				},
				{
					path: 'shouruxinxiAdd',
					component: shouruxinxiAdd
				},
				{
					path: 'zhichuxinxi',
					component: zhichuxinxiList
				},
				{
					path: 'zhichuxinxiDetail',
					component: zhichuxinxiDetail
				},
				{
					path: 'zhichuxinxiAdd',
					component: zhichuxinxiAdd
				},
				{
					path: 'zhichuleixing',
					component: zhichuleixingList
				},
				{
					path: 'zhichuleixingDetail',
					component: zhichuleixingDetail
				},
				{
					path: 'zhichuleixingAdd',
					component: zhichuleixingAdd
				},
				{
					path: 'shouzhiyusuan',
					component: shouzhiyusuanList
				},
				{
					path: 'shouzhiyusuanDetail',
					component: shouzhiyusuanDetail
				},
				{
					path: 'shouzhiyusuanAdd',
					component: shouzhiyusuanAdd
				},
				{
					path: 'beiwanglu',
					component: beiwangluList
				},
				{
					path: 'beiwangluDetail',
					component: beiwangluDetail
				},
				{
					path: 'beiwangluAdd',
					component: beiwangluAdd
				},
				{
					path: 'touzilicai',
					component: touzilicaiList
				},
				{
					path: 'touzilicaiDetail',
					component: touzilicaiDetail
				},
				{
					path: 'touzilicaiAdd',
					component: touzilicaiAdd
				},
				{
					path: 'zhaiwuxinxi',
					component: zhaiwuxinxiList
				},
				{
					path: 'zhaiwuxinxiDetail',
					component: zhaiwuxinxiDetail
				},
				{
					path: 'zhaiwuxinxiAdd',
					component: zhaiwuxinxiAdd
				},
				{
					path: 'yinxingchuxu',
					component: yinxingchuxuList
				},
				{
					path: 'yinxingchuxuDetail',
					component: yinxingchuxuDetail
				},
				{
					path: 'yinxingchuxuAdd',
					component: yinxingchuxuAdd
				},
				{
					path: 'newstype',
					component: newstypeList
				},
				{
					path: 'newstypeDetail',
					component: newstypeDetail
				},
				{
					path: 'newstypeAdd',
					component: newstypeAdd
				},
				{
					path: 'popupremind',
					component: popupremindList
				},
				{
					path: 'popupremindDetail',
					component: popupremindDetail
				},
				{
					path: 'popupremindAdd',
					component: popupremindAdd
				},
				{
					path: 'aboutus',
					component: aboutusList
				},
				{
					path: 'aboutusDetail',
					component: aboutusDetail
				},
				{
					path: 'aboutusAdd',
					component: aboutusAdd
				},
				{
					path: 'systemintro',
					component: systemintroList
				},
				{
					path: 'systemintroDetail',
					component: systemintroDetail
				},
				{
					path: 'systemintroAdd',
					component: systemintroAdd
				},
				{
					path: 'discussredianxinwen',
					component: discussredianxinwenList
				},
				{
					path: 'discussredianxinwenDetail',
					component: discussredianxinwenDetail
				},
				{
					path: 'discussredianxinwenAdd',
					component: discussredianxinwenAdd
				},
			]
		},
		{
			path: '/login',
			component: Login
		},
		{
			path: '/register',
			component: Register
		},
	]
})
